home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 233 / Computer Shopper 233 / ComputerShopperDVD233.iso / mpf / eng / shared / agentdui.cab / scui.dll / HTML / OEMCFG.VBS < prev    next >
Encoding:
Text File  |  2005-07-27  |  9.0 KB  |  390 lines

  1. Option Explicit
  2.  
  3. Function GetOemId(objReg)
  4. '{
  5.     Dim szOemId, bObfuscate
  6.     GetOemId = False
  7.  
  8.     If objReg Is Nothing Then
  9.         Exit Function
  10.     End If
  11.  
  12.     bObfuscate = objReg.Obfuscate
  13.     objReg.Obfuscate = True
  14.  
  15.     GetOemId = objReg.RegQueryValue( DB_REGKEY_OEM, DB_REGVAL_OEMID ) 
  16.  
  17.     objReg.Obfuscate = bObfuscate
  18. '}
  19. End Function
  20.  
  21. Function GetOEMIniFile(objReg, objFS, objOS)
  22. '{
  23.     Dim szTemp
  24.     
  25.     GetOEMIniFile = ""
  26.     szTemp = objReg.RegQueryValue( DB_REGKEY_OEM_LINK_STR, DB_OEM_INI )
  27.   
  28.     If ( szTemp <> "" ) Then
  29.         If ( False = objFS.IsFile( szTemp ) ) Then
  30.             szTemp = ""
  31.         End If
  32.     End If
  33.  
  34.     If ( szTemp = "" ) Then
  35.         szTemp = objOS.GetObjectModuleDir( CLSID_MCAgent ) & DEF_OEM_INI_FILE
  36.     End If
  37.  
  38.     If ( szTemp <> "" ) Then
  39.         If ( False = objFS.IsFile( szTemp ) ) Then
  40.             Exit Function
  41.         End If
  42.     Else
  43.         Exit Function
  44.     End If
  45.  
  46.     GetOEMIniFile = szTemp
  47.  
  48. '}
  49. End Function
  50.  
  51. Function GetNewsTitleOEM()
  52. '{
  53.     Dim szOEMIniFile
  54.     szOEMIniFile = GetOEMIniFile(gDBobjReg, gDBobjFS, gDBobjOS)
  55.     If ("" <> szOEMIniFile) Then
  56.         GetNewsTitleOEM = gDBobjReg.IniGetValue(szOEMIniFile, OEMINI_OEMNEWS_SECTION, OEMINI_OEMTITLE_VALUE)
  57.     Else
  58.         GetNewsTitleOEM = ""
  59.     End If
  60. '}
  61. End Function
  62.  
  63. Function GetNewsStringOEM()
  64. '{
  65.     Dim szOEMIniFile
  66.     szOEMIniFile = GetOEMIniFile(gDBobjReg, gDBobjFS, gDBobjOS)
  67.     If ("" <> szOEMIniFile) Then
  68.         GetNewsStringOEM = gDBobjReg.IniGetValue(szOEMIniFile, OEMINI_OEMNEWS_SECTION, OEMINI_OEMNEWS_VALUE)
  69.     Else
  70.         GetNewsStringOEM = ""
  71.     End If
  72. '}
  73. End Function
  74.  
  75. Function ShowTab(szAppID, szOEMIniFile, nDefault)
  76. '{
  77.     Dim szHomePage
  78.  
  79.     ShowTab = nDefault
  80.     If ("" <> szOEMIniFile) Then
  81.         ShowTab = gDBobjReg.IniGetValue(szOEMIniFile, OEMINI_SHOWTABS_SECTION, szAppID)
  82.     End If
  83.  
  84.     szHomePage = gObjDashboard.GetApplicationInfo( CStr(szAppID), DB_HOMEPAGE )
  85.             
  86.     If (0 < Len(szHomePage)) Then
  87.         ShowTab = 1
  88.     End If
  89.  
  90. '}
  91. End Function
  92.  
  93. Function IsPlus(szAppID, szOEMIniFile, bDefault)
  94. '{
  95.     Dim dwPlus
  96.  
  97.     IsPlus = bDefault
  98.     If ("" <> szOEMIniFile) Then
  99.         dwPlus = gDBobjReg.IniGetValue(szOEMIniFile, szAppID, OEMINI_PLUS_KEY)
  100.         If (1 = dwPlus) Then
  101.             IsPlus = True
  102.         Else
  103.             IsPlus = False
  104.         End If
  105.     End If
  106.  
  107. '}
  108. End Function
  109.  
  110.  
  111. Function GetAppIndex(szAppID, szOEMIniFile, ByRef objReg)
  112. '{
  113.  
  114.     Dim dwIndex
  115.     
  116.     ' Sameer(02/15/2005): By default the app indices are always hidden. Basically, they are controlled
  117.     ' by the tab values. If tab is hidden then indices are hidden otherwise they are displayed. If
  118.     ' we forcefully create a value in OEMCFG.INI with <AppId>=1 then the indices will be shown no matter
  119.     ' what is the state of the tab. This was done for backward compatibility where partners expected
  120.     ' the tab to be hidden but they wanted the index. For these partners we have create <Appid>=1
  121.     ' under the Security_Index section in OEMCFG.INI.
  122.  
  123.     GetAppIndex = 0
  124.  
  125.     If Not objReg Is Nothing Then
  126.     '{
  127.  
  128.         If ("" <> szOEMIniFile) Then
  129.  
  130.             dwIndex = objReg.IniGetValue(szOEMIniFile, OEMINI_SECURITY_INDEX, szAppID )
  131.  
  132.             If "" <> dwIndex Then
  133.             '{
  134.  
  135.                 If ( CLng(0) <> CLng(dwIndex) ) Then
  136.                     GetAppIndex = 1
  137.                 Else
  138.                     GetAppIndex = 0
  139.                 End If
  140.  
  141.             '}
  142.             End If
  143.  
  144.         End If
  145.  
  146.     '}
  147.     End If
  148.  
  149. '}
  150. End Function
  151.  
  152.  
  153. Function GetOEMLogo(szOEMIniFilePath, objReg, objFS, objOS, szDefault)
  154. '{
  155.     Dim szLogoPath, szLogoFile, szLogoUIFilePath
  156.     Const szLogoUIFile = "oemlogo.ui"
  157.  
  158.     GetOEMLogo = szDefault
  159.     szLogoPath = objOS.GetObjectModuleDir( CLSID_MCAgent )
  160.     If ("" <> szLogoPath) Then
  161.       szLogoFile = objReg.IniGetValue( szOEMIniFilePath, MYS_SECTION, OEMINI_SEC_CEN_LOGO_FILE )
  162.       If ("" <> szLogoFile) Then
  163.       '{
  164.           ' Check if a UI file exists
  165.           szLogoUIFilePath = szLogoPath & "\" & szLogoUIFile
  166.           If (True = objFS.IsFile(szLogoUIFilePath)) Then
  167.           '{
  168.                 GetOEMLogo = szLogoUIFile & "::" & szLogoFile
  169.           '}
  170.           Else
  171.           '{
  172.               szLogoPath = szLogoPath & "\" & szLogoFile
  173.               If (True = objFS.IsFile(szLogoPath)) Then
  174.                 GetOEMLogo = szLogoPath
  175.               End If
  176.           '}
  177.           End If
  178.       '}
  179.       End If
  180.     End If
  181. '}
  182. End Function
  183.  
  184. Function GetExpiryNag(objReg, objFS, objOS, nDefault)
  185. '{
  186.     Dim szIniPath, szValue
  187.     GetExpiryNag = nDefault
  188.  
  189.     szIniPath = GetOEMIniFile(objReg, objFS, objOS)
  190.  
  191.     If ("" <> szIniPath) Then
  192.       szValue = objReg.IniGetValue(szIniPath, MYS_SECTION, OEMINI_EXPIRY_INFO)
  193.       If ("" <> szValue) Then
  194.           GetExpiryNag = CLng(szValue)
  195.       End If
  196.     End If
  197. '}
  198. End Function
  199.  
  200.  
  201. Function ShowSecurityNews()
  202. '{
  203.     Dim szOEMIniFile, strShowSecNews
  204.  
  205.     ShowSecurityNews = True
  206.     strShowSecNews = ""
  207.  
  208.     szOEMIniFile = GetOEMIniFile(gDBobjReg, gDBobjFS, gDBobjOS)
  209.     If ("" <> szOEMIniFile) Then
  210.         strShowSecNews = Trim(CStr(gDBobjReg.IniGetValue(szOEMIniFile, OEMINI_OEMNEWS_SECTION, OEMINI_SHOWSECNEWS_KEY)))
  211.     End If
  212.  
  213.     If "" <> strShowSecNews Then
  214.     '{
  215.         If "0" = strShowSecNews Then
  216.             ShowSecurityNews = False
  217.         End If
  218.     '}
  219.     End If
  220. '}
  221. End Function
  222.  
  223.  
  224. Function ShowStoreLink()
  225. '{
  226.     Dim szOEMIniFile, strShowStoreLink
  227.  
  228.     ShowStoreLink = True
  229.     strShowStoreLink = ""
  230.  
  231.     szOEMIniFile = GetOEMIniFile(gDBobjReg, gDBobjFS, gDBobjOS)
  232.     If ("" <> szOEMIniFile) Then
  233.         strShowStoreLink = Trim(CStr(gDBobjReg.IniGetValue(szOEMIniFile, OEMINI_OEMNEWS_SECTION, OEMINI_SHOWSTORELINK_KEY)))
  234.     End If
  235.  
  236.     If "" <> strShowStoreLink Then
  237.     '{
  238.         If "0" = strShowStoreLink Then
  239.             ShowStoreLink = False
  240.         End If
  241.     '}
  242.     End If
  243. '}
  244. End Function
  245.  
  246.  
  247. Function ShowCustSupportLink()
  248. '{
  249.     Dim szOEMIniFile, strShowCustSupportLink
  250.  
  251.     ShowCustSupportLink = 1
  252.     strShowCustSupportLink = ""
  253.  
  254.     szOEMIniFile = GetOEMIniFile(gDBobjReg, gDBobjFS, gDBobjOS)
  255.     If ("" <> szOEMIniFile) Then
  256.         strShowCustSupportLink = Trim(CStr(gDBobjReg.IniGetValue(szOEMIniFile, MYS_SECTION, OEMINI_SHOW_CUSTSUPPORT_LINK_KEY)))
  257.     End If
  258.  
  259.     If "" <> strShowCustSupportLink Then
  260.     '{
  261.         If "0" = strShowCustSupportLink Then
  262.             ShowCustSupportLink = 0
  263.         End If
  264.     '}
  265.     End If
  266. '}
  267. End Function
  268.  
  269.  
  270. Function ShowHelpLink()
  271. '{
  272.     Dim szOEMIniFile, strShowHelpLink
  273.  
  274.     ShowHelpLink = 1
  275.     strShowHelpLink = ""
  276.  
  277.     szOEMIniFile = GetOEMIniFile(gDBobjReg, gDBobjFS, gDBobjOS)
  278.     If ("" <> szOEMIniFile) Then
  279.         strShowHelpLink = Trim(CStr(gDBobjReg.IniGetValue(szOEMIniFile, MYS_SECTION, OEMINI_SHOW_HELP_LINK_KEY)))
  280.     End If
  281.  
  282.     If "" <> strShowHelpLink Then
  283.     '{
  284.         If "0" = strShowHelpLink Then
  285.             ShowHelpLink = 0
  286.         End If
  287.     '}
  288.     End If
  289. '}
  290. End Function
  291.  
  292.  
  293. Function GetCustomHelpUrl()
  294. '{
  295.     Dim szOEMIniFile, strCustomHelpUrl
  296.  
  297.     GetCustomHelpUrl = ""
  298.     strCustomHelpUrl = ""
  299.  
  300.     szOEMIniFile = GetOEMIniFile(gDBobjReg, gDBobjFS, gDBobjOS)
  301.     If ("" <> szOEMIniFile) Then
  302.         strCustomHelpUrl = Trim(CStr(gDBobjReg.IniGetValue(szOEMIniFile, MYS_SECTION, OEMINI_CUSTOM_HELP_LINK)))
  303.     End If
  304.  
  305.     If "" <> strCustomHelpUrl Then
  306.     '{
  307.         GetCustomHelpUrl = strCustomHelpUrl
  308.     '}
  309.     End If
  310.  
  311. '}
  312. End Function
  313.  
  314. Function GetCustomSupportUrl()
  315. '{
  316.     Dim szOEMIniFile, strCustomSupportUrl
  317.  
  318.     GetCustomSupportUrl = ""
  319.     strCustomSupportUrl = ""
  320.  
  321.     szOEMIniFile = GetOEMIniFile(gDBobjReg, gDBobjFS, gDBobjOS)
  322.     If ("" <> szOEMIniFile) Then
  323.         strCustomSupportUrl = Trim(CStr(gDBobjReg.IniGetValue(szOEMIniFile, MYS_SECTION, OEMINI_CUSTOM_CUSTSUPPORT_LINK)))
  324.     End If
  325.  
  326.     If "" <> strCustomSupportUrl Then
  327.     '{
  328.         GetCustomSupportUrl = strCustomSupportUrl
  329.     '}
  330.     End If
  331.  
  332. '}
  333. End Function
  334.  
  335. Function GetWindowsFirewallUpsellURL(ByRef objReg, ByRef objFS, ByRef objOS)
  336. '{
  337.     Dim szOEMIniFile, strURL
  338.  
  339.     GetWindowsFirewallUpsellURL = MYS_WIN_FW_UPGRADE_URL
  340.     strURL = ""
  341.  
  342.     szOEMIniFile = GetOEMIniFile(objReg, objFS, objOS)
  343.     If ("" <> szOEMIniFile) Then
  344.         strURL = Trim(CStr(objReg.IniGetValue(szOEMIniFile, UPSELL_SECTION, OEMINI_UPSELL_WINFW)))
  345.     End If
  346.  
  347.     If "" <> strURL Then
  348.     '{
  349.         GetWindowsFirewallUpsellURL = strURL
  350.     '}
  351.     End If
  352. '}
  353. End Function
  354.  
  355. Function GetNAVUpsellURL(ByRef objReg, ByRef objFS, ByRef objOS)
  356. '{
  357.     Dim szOEMIniFile, strURL
  358.  
  359.     GetNAVUpsellURL = NORTON_UPGRADE_URL
  360.     strURL = ""
  361.  
  362.     szOEMIniFile = GetOEMIniFile(objReg, objFS, objOS)
  363.     If ("" <> szOEMIniFile) Then
  364.         strURL = Trim(CStr(objReg.IniGetValue(szOEMIniFile, UPSELL_SECTION, OEMINI_UPSELL_NAVAV)))
  365.     End If
  366.  
  367.     If "" <> strURL Then
  368.     '{
  369.         GetNAVUpsellURL = strURL
  370.     '}
  371.     End If
  372. '}
  373. End Function
  374.  
  375. Function HideLink(szOEMIniFile, bDefault, szTabName, szLinkName)
  376. '{
  377.     Dim dwHideLink
  378.  
  379.     HideLink = bDefault
  380.     If ("" <> szOEMIniFile) Then
  381.         dwHideLink = g_localObjReg.IniGetValue(szOEMIniFile, szTabName, szLinkName)
  382.         if IsNumeric(dwHideLink)  Then
  383.           if (0 <> dwHideLink) Then
  384.             HideLink = True
  385.           End if
  386.         End If
  387.     End If
  388.  
  389. '}
  390. End Function